﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text.RegularExpressions;
using System.Collections;
using System.Globalization;

namespace Mukhopatro.Helpers
{
    public class SiteUtility
    {
        private Boolean IsEmail(String stringToMatch)
        {
            return Regex.IsMatch(stringToMatch, @"^[a-z A-Z 0-9 \s]+$", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Multiline | RegexOptions.CultureInvariant);
        }

        public SortedList GetCountries()
        {
            SortedList slCountry = new SortedList();
            string Key = "";
            string Value = "";            

            foreach (CultureInfo info in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
            {
                RegionInfo info2 = new RegionInfo(info.LCID);
                if (!slCountry.Contains(info2.EnglishName))
                {
                    Value = info2.TwoLetterISORegionName;
                    Key = info2.EnglishName;
                    slCountry.Add(Key, Value);
                }
            }
            return slCountry;
        }

    }
}